#ifndef __PWM_INIT_H__
#define __PWM_INIT_H__


#define LEDC_MODE               LEDC_LOW_SPEED_MODE 

//定时器0，通道IO定义。一个定时器吃八路通道
#define LEDC_TIMER0_CH0_IO          (15) 
#define LEDC_TIMER0_CH1_IO          (19) 
#define LEDC_TIMER0_CH2_IO          (12) 
#define LEDC_TIMER0_CH3_IO          (32)
/*----------------------------------------*/ 
#define LEDC_TIMER0_CH4_IO          (2) 
#define LEDC_TIMER0_CH5_IO          (21) 
#define LEDC_TIMER0_CH6_IO          (13) 
#define LEDC_TIMER0_CH7_IO          (33) 

//定时器占空比控制舵机_角度
//除调试外，禁止使用这两个角度
// #define LEDC_DUTY_0             (26)
// #define LEDC_DUTY_180           (124)
#define LEDC_DUTY_45            (52)
#define LEDC_DUTY_90            (78)
#define LEDC_DUTY_135           (100)

#define LEDC_DUTY_foot_0             (26)
#define LEDC_DUTY_foot_180           (124)
#define LEDC_DUTY_foot_45            (52)
#define LEDC_DUTY_foot_90            (78)
#define LEDC_DUTY_foot_135           (100)


#define LEDC_CH0            LEDC_CHANNEL_0
#define LEDC_CH1            LEDC_CHANNEL_1
#define LEDC_CH2            LEDC_CHANNEL_2
#define LEDC_CH3            LEDC_CHANNEL_3
#define LEDC_CH4            LEDC_CHANNEL_4
#define LEDC_CH5            LEDC_CHANNEL_5
#define LEDC_CH6            LEDC_CHANNEL_6
#define LEDC_CH7            LEDC_CHANNEL_7



#define LEDC_DUTY_RES           LEDC_TIMER_10_BIT //统一使用10位分辨率
#define LEDC_FREQUENCY          (50) // Frequency in Hertz. Set frequency at 5 kHz


#define LEDC_TIMER0              LEDC_TIMER_0
#define LEDC_TIMER1              LEDC_TIMER_1
#define LEDC_TIMER2              LEDC_TIMER_2
#define LEDC_TIMER3              LEDC_TIMER_3


void ctl_PWM(uint8_t ctl_num );
void Timer0_init(void);
// void Timer1_init(void);
// void Timer2_init(void);
// void Timer3_init(void);



#endif 
